package com.acminds.fotoporter.persistence.entities;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the PRIVILEGE database table.
 * 
 */
@Entity
@Table(name="PRIVILEGE")
public class Privilege extends com.acminds.fotoporter.persistence.BaseDTO implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(name="PRIVILEGE_ID")
	private int privilegeId;

	@Column(name="PRIV_CODE")
	private String privCode;

	@Column(name="PRIV_DESC")
	private String privDesc;

	@Column(name="PRIV_NAME")
	private String privName;
	
	@Column(name="TRAN_URI")
	private String tranUri;	

	//bi-directional many-to-many association to Role
    @ManyToMany
	@JoinTable(
		name="RL_ROLE_PRIVILEGE"
		, joinColumns={
			@JoinColumn(name="PRIVILEGE_ID")
			}
		, inverseJoinColumns={
			@JoinColumn(name="ROLE_ID")
			}
		)
	private List<Role> roles;

    public Privilege() {
    }

	public int getPrivilegeId() {
		return this.privilegeId;
	}

	public void setPrivilegeId(int privilegeId) {
		this.privilegeId = privilegeId;
	}

	public String getPrivCode() {
		return this.privCode;
	}

	public void setPrivCode(String privCode) {
		this.privCode = privCode;
	}

	public String getPrivDesc() {
		return this.privDesc;
	}

	public void setPrivDesc(String privDesc) {
		this.privDesc = privDesc;
	}

	public String getPrivName() {
		return this.privName;
	}

	public void setPrivName(String privName) {
		this.privName = privName;
	}
	
	public String getTranUri() {
		return tranUri;
	}

	public void setTranUri(String tranUri) {
		this.tranUri = tranUri;
	}

	public List<Role> getRoles() {
		return this.roles;
	}

	public void setRoles(List<Role> roles) {
		this.roles = roles;
	}
	
}